package com.wen.jwtdemo.config;

import com.wen.jwtdemo.handler.JwtInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class WebCOnfiguration implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new JwtInterceptor())
                .addPathPatterns("/demo/getMsg")   //其他接口token验证
                .excludePathPatterns("/demo/login");   //所有用户都可以使用
    }
}
